package qiujing.online.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qiujing.online.model.CommentTemplate;
import qiujing.online.response.Result;
import qiujing.online.response.ResultVOUtil;

/**
 * Created by 的川 on 2018/12/8.
 */
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Autowired
    private CommentTemplate commentTemplate;

    /**
     * 获取评论列表
     * @param id
     * @return
     */
    @GetMapping(value = "/target/{id}")
    public Result findByTarget(@PathVariable String id){
        return ResultVOUtil.success(commentTemplate.findByTarget(id));
    }


}
